vt-d: Fix crash issue when not sharing EPT and VT-d tables.
authorKeir Fraser <keir@xen.org>
Fri, 14 Jan 2011 08:08:37 +0000 (08:08 +0000)
committerKeir Fraser <keir@xen.org>
Fri, 14 Jan 2011 08:08:37 +0000 (08:08 +0000)
Signed-off-by: Allen Kay <allen.m.kay@intel.com>
xen/drivers/passthrough/vtd/iommu.c

index b04203dcc7756efdc0e9b260da08dd72ad33e2f6..dee64ff5101ae18fff06b5f8a1ae8141634b89f2 100644 (file)
@@ -1773,9 +1773,13 @@ void iommu_set_pgd(struct domain *d)
     ASSERT( is_hvm_domain(d) && d->arch.hvm_domain.hap_enabled );
 
     iommu_hap_pt_share = vtd_ept_share();
+    if ( !iommu_hap_pt_share )
+        goto out;
+
     pgd_mfn = pagetable_get_mfn(p2m_get_pagetable(p2m_get_hostp2m(d)));
     hd->pgd_maddr = pagetable_get_paddr(pagetable_from_mfn(pgd_mfn));
 
+out:
     dprintk(XENLOG_INFO VTDPREFIX,
             "VT-d page table %s with EPT table\n",
             iommu_hap_pt_share ? "shares" : "not sharing");